package za.org.jcicada.confss;

import java.net.URI;

import za.org.jcicada.genss.ServiceURN;
import za.org.jcicada.genss.messages.Result;


/**
 * This interface has to be implemented by every class derived from ConfSS to ensure all the callbacks
 * and overridden functions are implemented in the class extending ConfSS.
 * @author lvdheever
 *
 */
public interface IConfSS {
	

    /**
     * Handle the reply to a requestLocateService
     * @param result - Result reported by CfgMngr onLocateService request
     * @param serviceURI - 
     * @param locationURI
     */
    public abstract void replyLocateService(Result result, ServiceURN serviceURN, URI locationURI) ;
    
    /**
     * Initialize the configurable software subsystem before use.
     * Do any specific initialization actions required before the subsystem starts running
     */
    public abstract void initializeSubsystem();
    
    /**
     * Do any specific actions required by the extended confss that is required in transition
     * into Initialize mode. Need to setMode(ModeEnum.MANAGE_MODE) if the subsystem must transition
     * to MANAGE on completion.
     * @throws Exception
     */
    public abstract void duringInitializeMode() throws Exception ;
    
    /**
     * Shut down the configurable software subsystem after use.
     * Do any specific shutdown actions required to ensure graceful shutdown of the subsystem.
     * At the very least, super.shutdown() is required.
     */
    public abstract void shutdownSubsystem();
    
    /**
     * Do any specific actions required by the extended confss that is required in transition
     * into shutdown mode. Need to call shutdownComplete.release(); when shutdown is complete.
     * At the very least, super.duringShutdown() is required.
     * @throws Exception
     */
    public abstract void duringShutdownMode() throws Exception ;
    
    /**
     * Wait for the GenSS to receive a halt or restart request.
     * @return true for restart else false to halt
     */
    //boolean waitHalt();
    
    /**
     * Add a sensor to the sensor subject
     * 
     * @param systemURN the URI of the system that contains the sensor
     * @param sensor the sensor object to add
     * @return the URI allocated to the sensor
     */
    //SensorURN addSensor(SystemURN systemURN, ISensor sensor) throws URISyntaxException;
    
    /**
     * Returns a sensor 
     * @todo is this required on IConfSS?
     */
    //ISensor getSensor(URI sensorURI) throws URISyntaxException;

    /**
     * @todo is this required on IConfSS?
     * @return
     */
    //URI getSubsystemURI();
    
    /**
     * @todo Any other accessors required on IConfSS?
     */
    
}